Skip to content

Key the object cache on the sources that generate the objects - #19

Merged
dreamsailing59-ops merged 1 commit into
ExpansionPak:mainfrom
dougchansan:pr/object-cache-emitter-digest
Aug 22, 2026
Merged

Key the object cache on the sources that generate the objects#19
dreamsailing59-ops merged 1 commit into
ExpansionPak:mainfrom
dougchansan:pr/object-cache-emitter-digest

Conversation

@dougchansan

Copy link
Copy Markdown
Contributor

What

DOLLLVM_CACHE_VERSION is a hand-edited string, so the generated-object cache only invalidates when someone remembers to bump it. It does not invalidate when the emitter changes — which is the case that matters, because a stale object means measuring code that is no longer in the tree.

Fix

Hash the sources that decide what gets emitted and fold the digest into every job key:

file(GLOB DOLRECOMP_CODEGEN_SOURCES CONFIGURE_DEPENDS
    "${CMAKE_CURRENT_SOURCE_DIR}/src/backend/*.c" ... )
string(SHA256 DOLRECOMP_CODEGEN_SOURCE_HASH "${DOLRECOMP_CODEGEN_DIGEST}")

A CONFIGURE_DEPENDS glob rather than an explicit file list, deliberately: an explicit list has to be maintained, and the recent backend rewrite renamed most of the files one would have contained. Editing any covered file re-runs configure, changes the digest, and changes every cache key.

Verification

Touching src/backend/llvm/psq.cpp moved the digest across the 46 covered files:

0f6d856945df91eb...  ->  880db2ba19f1765a...

28/28 ctest with it applied.

Note

This branch is cut from main, which does not currently link against the official LLVM 20 Windows package (see the target-registration PR). The digest was verified on a tree that also carries that link fix.

DOLLLVM_CACHE_VERSION is a hand-edited string, so the generated-object cache
only invalidates when someone remembers to bump it. It does not invalidate when
the emitter changes, which is the case that matters: a stale object is a
measurement of code that is no longer in the tree.

Hash the sources that decide what gets emitted and fold the digest into every
job key. The file list is a CONFIGURE_DEPENDS glob rather than an explicit list
-- an explicit list has to be maintained, and the backend rewrite renamed most
of the files one would have contained. Editing any covered file re-runs
configure and changes the digest, which changes every cache key.

Verified: touching src/backend/llvm/psq.cpp moved the digest from 0f6d8569 to
880db2ba across the 46 covered files, and 28/28 ctest passes with it applied.

Note this branch is cut from main, which does not currently link against the
official LLVM 20 Windows package; the digest was verified on a tree that also
carries that link fix.
@dreamsailing59-ops
dreamsailing59-ops merged commit 2645dc3 into ExpansionPak:main Aug 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants